//
//  HeWeather.swift
//  JTYP
//
//  Created by Groot on 2017/12/4.
//  Copyright © 2017年 inspur. All rights reserved.
//


import ObjectMapper
//MARK: - basic -

class HeWeatherBasic: Mappable {
    required init?(map: Map) {
        
    }
    
    func mapping(map: Map) {
        cid <- map["cid"]
        location <- map["location"]
        parent_city <- map["parent_city"]
        admin_area <- map["admin_area"]
        cnty <- map["cnty"]
        lat <- map["lat"]
        lon <- map["lon"]
        tz <- map["tz"]
    }
    
    var cid: String?
    var location: String?
    var parent_city: String?
    var admin_area: String?
    var cnty: String?
    var lat: String?
    var lon: String?
    var tz: String?
}

//MARK: - update -

class HeWeatherUpdate: Mappable {
    var loc: String?
    var utc: String?
    required init?(map: Map) {
        
    }
    
    func mapping(map: Map) {
        loc <- map["loc"]
        utc <- map["utc"]
    }
}

//MARK: - daily_forecast -

class HeWeatherDailyForecast: Mappable{
    var cond_code_d: String?
    var cond_code_n: String?
    var cond_txt_d: String?
    var cond_txt_n: String?
    var date: String?
    var hum: String?
    var mr: String?
    var ms: String?
    var pcpn: String?
    var pop: String?
    var pres: String?
    var sr: String?
    var ss: String?
    var tmp_max: String?
    var tmp_min: String?
    var uv_index: String?
    var vis: String?
    var wind_deg: String?
    var wind_dir: String?
    var wind_sc: String?
    var wind_spd: String?
    
    required init?(map: Map) {
        
    }
    
    func mapping(map: Map) {
        cond_code_d   <- map["cond_code_d"]
        cond_code_n   <- map["cond_code_n"]
        cond_txt_d    <- map["cond_txt_d"]
        cond_txt_n    <- map["cond_txt_n"]
        date          <- map["date"]
        hum           <- map["hum"]
        mr            <- map["mr"]
        ms            <- map["ms"]
        pcpn          <- map["pcpn"]
        pop           <- map["pop"]
        pres          <- map["pres"]
        sr            <- map["sr"]
        ss            <- map["ss"]
        tmp_max       <- map["tmp_max"]
        tmp_min       <- map["tmp_min"]
        uv_index      <- map["uv_index"]
        vis           <- map["vis"]
        wind_deg      <- map["wind_deg"]
        wind_dir      <- map["wind_dir"]
        wind_sc       <- map["wind_sc"]
        wind_spd      <- map["wind_spd"]
    }
}

//MARK: - HeWeather6 -

class HeWeather6s: Mappable{
    var basic: HeWeatherBasic?
    var update: HeWeatherUpdate?
    var status: String?
    var daily_forecast: [HeWeatherDailyForecast]?
    
    required init?(map: Map) {
    }
    
    func mapping(map: Map) {
        basic <- map["basic"]
        update <- map["update"]
        status <- map["status"]
        daily_forecast <- map["daily_forecast"]

    }
}

//MARK: - BaseClass -

class heWeatherBaseClass: Mappable{
    
    var HeWeather6: [HeWeather6s]?
    
    required init?(map: Map) {
    }
    
    func mapping(map: Map) {
        HeWeather6 <- map["HeWeather6"]
    }
}

